package patternrecognition.symbols;

import java.util.List;

import patternrecognition.symbols.forms.Rectangle;

public class T extends Symbol {

	@Override
	public String getID() {
		return "T";
	}

	@Override
	protected boolean isSymbol(final List<Rectangle> rectangles) {
		if (rectangles.size() == 2) {
			Rectangle upperRectangle = rectangles.get(0);
			Rectangle lowerRectangle = rectangles.get(1);

			if (upperRectangle.isFilled() && lowerRectangle.isFilled()) {
				return lowerRectangle.hasInnerLeftBorder(upperRectangle)
						&& lowerRectangle.hasInnerRightBorder(upperRectangle);
			}
		}
		return false;
	}

	@Override
	protected Object clone() throws CloneNotSupportedException {
		return new T();
	}
}
